package com.bwie.controller;

import com.bwie.pojo.TbLog;
import com.bwie.pojo.couponCode;
import com.bwie.service.CouponService;
import com.bwie.utils.R;
import com.bwie.vo.PageInfoVo;
import com.bwie.vo.couponCodeVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/coupon/coupon")
public class CouponController {
    @Autowired
    CouponService couponService;
    /**
     * @Author: huliwen
     * @Date: 2025/5/19 13:30
     * 分页列表展示劵码
     */
    @PostMapping("/selectCoupon")
    public R selectCoupon(@RequestBody couponCodeVo couponCodeVo){
        return couponService.selectCoupon(couponCodeVo);
    }
    /**
     * @Author: huliwen
     * @Date: 2025/5/19 13:31
     * 添加卷码
     */
    @PostMapping("/conPonAdd")
    public R couPonAdd(@RequestBody couponCode couponCode){
        return couponService.couPonAdd(couponCode);
    }
    /**
     * @Author: huliwen
     * @Date: 2025/5/19 13:42
     * 卖劵列表分页展示
     */
    @PostMapping("/selectSell")
    public R selectSell(@RequestBody PageInfoVo pageInfoVo){
        return couponService.selectSell(pageInfoVo);
    }
    /**
     * @Author: huliwen
     * @Date: 2025/5/19 13:43
     * 买劵列表分页展示
     */
    @PostMapping("/selectBuy")
    public R selectBuy(@RequestBody PageInfoVo pageInfoVo){
        return couponService.selectBuy(pageInfoVo);
    }
    /**
     * @Author: huliwen
     * @Date: 2025/5/19 15:33
     * 订单信息分页展示
     */
    @PostMapping("/selectLog")
    public R selectLog(@RequestBody PageInfoVo pageInfoVo){
        return  couponService.selectLog(pageInfoVo);
    }
    /**
     * @Author: huliwen
     * @Date: 2025/5/19 15:45
     * 收货后修改订单状态
     */
    @PostMapping("/updateLogs")
    public R updateLogs(@RequestBody TbLog  tbLog){
        return couponService.updateLogs(tbLog);
    }

}
